ci: use Ubuntu shfmt shell formatter - #2583
Conversation
|
Please review, as it replaces your special Docker image for checking shell scripts and uses instead the standard package from Ubuntu. |
nschonni
left a comment
There was a problem hiding this comment.
Don't know if pinning the install version would make sense or not. If Dependabot couldn't bump it I wouldn't bother, but if it could, then might make sense. Doesn't need to block this
There's an open enhancement request for Dependabot to handle OS packages, however at the moment it's not on the list of Dependabot supported ecosystems. |
|
I'm going to merge as-is. If we find something better later we can always update it. |
peterdavehello/shfmt:2.6.3inshfmt.yml#2555Description
Replace custom Docker image peterdavehello/shfmt:2.6.3 in .github/workflows/shfmt.yml with Ubuntu package shfmt for shell script format linting.
Use shfmt -d for read-only
--difflinting in CI.Motivation and Context
peterdavehello/shfmt:2.6.3in .github/workflows/shfmt.yml was published in Jan 2019 and is outdated.Ubuntu offers the package shfmt which relieves the need for a specially built Docker image to perform shell script linting in CI. It is also available in Debian. See https://github.com/mvdan/sh.
Testing Details
Locally in Ubuntu 24.04.4 LTS, execute:
sudo apt-get update sudo apt-get install -y shfmt shfmt -sr -i 2 -l -w -ci -d .and confirm no error reported.
Check for success of job
shfmtin workflow .github/workflows/shfmt.ymlTypes of changes
Checklist